import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from "../views/Index.vue"
import HelloWorld from "../views/HelloWorld.vue"
import Map3DDemo1 from "@/views/Map3DDemo1.vue"
import Map3DDemo2 from "@/views/Map3DDemo2.vue"
import Map3DDemo3 from "@/views/Map3DDemo3.vue"
import Map3DDemo4 from "@/views/Map3DDemo4.vue"

Vue.use(VueRouter)

const routes = [{
    path: "/",
    name: "平面地图",
    component: Index,
    redirect: "/HelloWorld1",
    show: true,

    children: [
        {
            path: "/HelloWorld1",
            name: "HelloWorld1",
            component: HelloWorld
        },
    ],
},{
    path: "/Map3D",
    name: "三维地图",
    component: Index,
    redirect: "/Map3DDemo1",
    show: true,

    children: [
        {
            path: "/Map3DDemo1",
            name: "Map3DDemo1",
            component: Map3DDemo1
        },
        {
            path: "/Map3DDemo2",
            name: "Map3DDemo2",
            component: Map3DDemo2
        },
        {
            path: "/Map3DDemo3",
            name: "Map3DDemo3",
            component: Map3DDemo3
        },
        {
            path: "/Map3DDemo4",
            name: "Map3DDemo4",
            component: Map3DDemo4
        },
    ],
}]

const router = new VueRouter({
    mode: 'hash',
    base: process.env.BASE_URL || 'http://127.0.0.1:8080',
    routes
})

export default router
